package com.project.service;

import com.project.entity.Discuss;
import com.project.entity.KnowLedge;
import com.project.mapper.DiscussMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DiscussService {
    @Autowired
    private DiscussMapper discussMapper;

    //根据农业id查询所有评论
    public List<KnowLedge> findById(Integer knowledgeId){

        List<KnowLedge> list = discussMapper.findById(knowledgeId);
        return list;
    }


    //添加数据
    public void insert(Discuss discuss){
        discussMapper.insert(discuss);
    }

}
